//
//  NetRequest+Lore.m
//  项目三
//
//  Created by rimi1 on 2016/11/25.
//  Copyright © 2016年 Wangxingqian. All rights reserved.
//

#import "NetRequest+Lore.h"

@implementation NetRequest (Lore)

@end
// 知识列表
@implementation NetRequest (LoreList)

+ (void)getLoreListRequestWithParameter:(NSDictionary *)parameter
                                succeed:(Succeed)succeed
                                failure:(Failure)failure {
    // 直接取 健康饮食知识  id = 3
    NSString *httpUrl = [NSString stringWithFormat:@"%@%@", LORE_URL, @"list"];
    [NetRequest getRequestWithUrl:httpUrl parameter:parameter succeed:^(id response) {
        succeed(response);
    } failure:^(NSError *error) {
        failure(error);
    }];
}

@end
// 知识详情
@implementation NetRequest (LoreShow)

+ (void)getLoreShowRequestWithParameter:(NSDictionary *)parameter
                                succeed:(Succeed)succeed
                                failure:(Failure)failure {
    NSString *httpUrl = [NSString stringWithFormat:@"%@%@", LORE_URL, @"show"];
    [NetRequest getRequestWithUrl:httpUrl parameter:parameter succeed:^(id response) {
        succeed(response);
    } failure:^(NSError *error) {
        failure(error);
    }];
}

@end
// 最新知识
@implementation NetRequest (LoreNews)

+ (void)getLoreNewsRequestWithParameter:(NSDictionary *)parameter
                                succeed:(Succeed)succeed
                                failure:(Failure)failure {
    NSString *httpUrl = [NSString stringWithFormat:@"%@%@", LORE_URL, @"news"];
    [NetRequest getRequestWithUrl:httpUrl parameter:parameter succeed:^(id response) {
        succeed(response);
    } failure:^(NSError *error) {
        failure(error);
    }];
}

@end








